﻿@page
@{
    ViewBag.Title = "首页";
}
@inject CategoryService _categoryService
@functions{ 
    IEnumerable<Category> Categories { get; set; }
    public async Task OnGetAsync()
    {
        this.Categories = await _categoryService.GetCategoriesAsync();
    }
}

<div class="card-deck">
    @foreach (var item in Categories)
    {
        @Html.Partial_CategoryArticleCard(new CategoryArticleViewModel(item.Id))
    }
</div>